package com.cakeshop.listener;

import java.util.List;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.ServletRequest;
import javax.servlet.annotation.WebListener;

import com.cakeshop.model.Comment;
import com.cakeshop.model.Type;
import com.cakeshop.service.CommentService;
import com.cakeshop.service.TypeService;
import com.cakeshop.service.impl.CommentServiceImpl;


@WebListener
public class ApplicationListener implements ServletContextListener {

	private TypeService tService = new TypeService();

    @Override
	public void contextDestroyed(ServletContextEvent arg0)  {

    }

    @Override
	public void contextInitialized(ServletContextEvent arg0)  {
    	List<Type> list = tService.selectAll();
    	arg0.getServletContext().setAttribute("typeList", list);
    }
	
}
